Imports System.Data.Common
Partial Class Presentation_Management_ClientProgress
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim Sql As String
        Dim CountSql As String
        Dim Params(0) As GenParameter

        Page.Title = "Client's Progress"

        Sql = "SELECT ClientMaster.ClientName, ExecutiveMaster.ExecutiveName, ProjectMaster.ProjectName, DATE_FORMAT(WorkflowMaster.MeetingDate,'%d/%m/%y') AS 'Meeting Date', " & _
         "ActionMaster.ActionDescription, WorkflowMaster.Details, WorkflowMaster.NextAction, DATE_FORMAT(WorkflowMaster.DateofNextAction,'%d/%m/%y') AS 'Date of Next Action' " & _
        "FROM ActionMaster INNER JOIN (ProjectMaster INNER JOIN (ExecutiveMaster INNER JOIN (ClientMaster INNER JOIN WorkflowMaster ON " & _
        "ClientMaster.ClientID = WorkflowMaster.ClientID) ON ExecutiveMaster.ExecutiveID = WorkflowMaster.ExecutiveID) ON " & _
        "ProjectMaster.ProjectID = WorkflowMaster.ProjectID) ON ActionMaster.ActionID = WorkflowMaster.ActionID " & _
        "WHERE ClientMaster.ClientName LIKE CONCAT('%',?ClientPart,'%')" & _
        " ORDER BY ClientMaster.ClientName, WorkflowMaster.MeetingDate"

        CountSql = "SELECT COUNT(*) " & _
        "FROM ActionMaster INNER JOIN (ProjectMaster INNER JOIN (ExecutiveMaster INNER JOIN (ClientMaster INNER JOIN WorkflowMaster ON " & _
        "ClientMaster.ClientID = WorkflowMaster.ClientID) ON ExecutiveMaster.ExecutiveID = WorkflowMaster.ExecutiveID) ON " & _
        "ProjectMaster.ProjectID = WorkflowMaster.ProjectID) ON ActionMaster.ActionID = WorkflowMaster.ActionID " & _
        "WHERE ClientMaster.ClientName LIKE CONCAT('%',?ClientPart,'%')" & _
        " ORDER BY ClientMaster.ClientName, WorkflowMaster.MeetingDate"

        Params(0) = New GenParameter("?ClientPart", txtClientPart.Text, Data.DbType.String)

        ClientProgress.Sql = Sql
        ClientProgress.CountSql = CountSql
        ClientProgress.Params = Params
        ClientProgress.ShowButton = True



    End Sub
End Class
